package se.wangs.singleton;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/6 11:27
 * @description 懒汉单例（线程不安全1）
 */
public class Singleton2 {
    private static Singleton2 singletonInstance;

    private Singleton2() {}

    private static Singleton2 getSingletonInstance() {
        if (singletonInstance == null) {
            singletonInstance = new Singleton2();
        }
        return singletonInstance;
    }
}
